﻿@typeparam TItem

<Table TItem="TItem" IsBordered="true" IsStriped="true" IsMultipleSelect="IsMultipleSelect" @ref="Instance"
       IsPagination="IsPagination" PageItemsSource="PageItemsSource" IsFixedHeader="IsFixedHeader"
       IsTree="IsTree" OnTreeExpand="OnTreeExpand!" TreeNodeConverter="TreeNodeConverter!" TreeIcon="fa-chevron-circle-right"
       ShowDefaultButtons="ShowDefaultButtons" ShowAdvancedSearch="ShowAdvancedSearch"
       ShowEmpty="ShowEmpty" EmptyText="暂无数据" EmptyImage="images/empty.svg" SortString="@SortString"
       OnQueryAsync="OnQueryAsync!" OnDeleteAsync="OnDeleteAsync!" OnSaveAsync="OnSaveAsync!"
       ShowSkeleton="true" ShowLoading="ShowLoading" ShowSearch="ShowSearch"
       ShowToolbar="ShowToolbar" ShowExtendButtons="ShowExtendButtons"
       ShowAddButton="@AuthorizeButton("add")" ShowDeleteButton="@AuthorizeButton("del")" ShowEditButton="@AuthorizeButton("edit")"
       ShowCardView="true" ShowColumnList="true" ExtendButtonColumnWidth="@ExtendButtonColumnWidth"
       CustomerSearchModel="CustomerSearchModel" SelectedRows="SelectedRows"
       ShowExtendEditButtonCallback="ShowExtendEditButtonCallback!" ShowExtendDeleteButtonCallback="ShowExtendDeleteButtonCallback!"
       TableToolbarTemplate="TableToolbarTemplate" TableColumns="TableColumns" EditTemplate="EditTemplate!"
       CustomerSearchTemplate="CustomerSearchTemplate!" RowButtonTemplate="RowButtonTemplate!"
       ShowExportButton="ShowExportButton" ShowExportCsvButton="ShowExportCsvButton" AutoGenerateColumns="AutoGenerateColumns"
       IsFixedFooter="true" AllowResizing="true" AllowDragColumn="true" ClientTableName="@ClientTableName"
       ColumnOrderCallback="OnColumnOrderCallback"
       OnDragColumnEndAsync="OnDragColumnEndAsync!"
       OnResizeColumnAsync="OnResizeColumnAsync">
</Table>


<script>
    function reloadColumnOrderEx(tableName) {
        const key = `bb-table-column-order-${tableName}`
        return localStorage.getItem(key);
    }

    function reloadColumnWidthEx(tableName) {
        const key = `bb-table-column-width-${tableName}`
        return localStorage.getItem(key);
    }

    function saveColumnOrderEx(options) {
        const key = `bb-table-column-order-${options.tableName}`
        localStorage.setItem(key, options.data);
    }

    function saveColumnWidthEx(options) {
        const key = `bb-table-column-width-${options.tableName}`
        localStorage.setItem(key, options.data);
    }

    function saveLocalStorage(key, options) {

    }
</script>